package com.huage.courseplatform.application.model.param;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.huage.courseplatform.framework.model.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="学生参数",description="学生参数")
public class StudentPARAM  implements Serializable {

    @NotEmpty(message = "id不能为空", groups = Update.class)
    @ApiModelProperty(value = "id(更新可以不传)",required = true)
    private String id;

    @NotEmpty(message = "用户id不能为空",groups = Insert.class)
    @ApiModelProperty(value = "关联用户ID(更新传入无效)",required = true)
    private String userId;

    @NotEmpty(message = "学生名不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "学生名")
    private String name;

    @NotEmpty(message = "性别不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "性别")
    private String sex;

    @Past(message = "出生时间,不得晚于当前时间",groups = {Update.class, Insert.class})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @ApiModelProperty(value = "出生时间")
    private String birthday;


    @ApiModelProperty(value = "联系地址")
    private String address;

    @ApiModelProperty(value = "母亲姓名")
    private String motherName;

    @Length(max = 11, min = 11,message = "请输入正确的手机号",groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "母亲联系电话")
    private String motherPhone;

    @ApiModelProperty(value = "父亲姓名")
    private String fatherName;

    @Length(max = 11, min = 11,message = "请输入正确的手机号",groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "父亲联系电话")
    private String fatherPhone;



}
